﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Data
{
    public class Connection
    {
        static SqlConnection _SqlConnection;

        public static SqlConnection StartConnection()
        {
            try
            {
                string strConnection = "Server=.;DataBase=ProjectSem3; Integrated Security=yes";
                _SqlConnection = new SqlConnection(strConnection);
                return _SqlConnection;
            }
            catch (Exception _epx)
            {
                throw _epx;
            }
        }

        public static SqlConnection CloseConnection()
        {
            _SqlConnection.Close();
            return _SqlConnection;
        }
    }
}
